]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overviewControls: Use correct state when updating AppDisplay visibility
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Sat, 10 Apr 2021 16:27:01 +0000 (13:27 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 12 Apr 2021 15:06:30 +0000 (12:06 -0300)
When OverviewControls goes from HIDDEN to APP_GRID, it constantly checks
if AppDisplay needs to be visible or not by checking the current overview
state is bigger than WINDOW_PICKER. Turns out in this case this check is
problematic, because when the current state trespasses WINDOW_PICKER, the
layout manager will have already positioned AppDisplay halfway to its final
position.

Use either the final or the current state, whichever is biggest, when updating
the AppDisplay visibility. It optionally allows passing the overview state
params to _updateAppDisplayVisibility() so that we avoid a few trampolines to
recaltulate the adjustment state.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1805>

js/ui/overviewControls.js

index a8974039d2fb8a6ab8a90286f1ece051aa8e9b31..10b97c7ac0652c3f7da5ffd76f859ea7be1fc08c 100644 (file)
@@ -518,9 +518,15 @@ class ControlsManager extends St.Widget {
         this._thumbnailsBox.ease(params);
     }
 
-    _updateAppDisplayVisibility() {
+    _updateAppDisplayVisibility(stateTransitionParams = null) {
+        if (!stateTransitionParams)
+            stateTransitionParams = this._stateAdjustment.getStateTransitionParams();
+
+        const { currentState, finalState } = stateTransitionParams;
+        const state = Math.max(currentState, finalState);
+
         this._appDisplay.visible =
-            this._stateAdjustment.value > ControlsState.WINDOW_PICKER &&
+            state > ControlsState.WINDOW_PICKER &&
             !this._searchController.searchActive;
     }
 
@@ -536,7 +542,7 @@ class ControlsManager extends St.Widget {
         fitModeAdjustment.value = fitMode;
 
         this._updateThumbnailsBox();
-        this._updateAppDisplayVisibility();
+        this._updateAppDisplayVisibility(params);
     }
 
     _onSearchChanged() {